Component({
  properties: {
    taskList: {
      type: Array
    }
  },
  data: {

  },
  methods: {
    taskDelete(e) {
      this.triggerEvent('delete-task-list', e.target.dataset.id)
    },
    handleChange(e) {
      const newTaskList = [...this.properties.taskList].map(item => {
        if (e.target.dataset.id === item.id) {
          item.selected = e.detail
        }
        return item
      })
      this.triggerEvent('task-list', newTaskList)
    }
  }
})